<form class="form-inline definewidth m20" action="{:U(GROUP_NAME . '/Advertise/index')}" method="post">
    标题：
    <input type="text" name="title" id="title" class="abc input-default" placeholder="" value="{:I('title')}">&nbsp;&nbsp;
    <select name="position" id="">
        <foreach name="posMap" item="v">
            <option value="{$key}" <if condition="$position eq $key">selected</if>>{$v}</option>
        </foreach>
    </select>
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
    <button type="button" class="btn btn-success" id="addnew">添加广告</button>
</form>
<table class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
        <th width="30">排序</th>
        <th width="30">ID</th>
        <th>图片/标题/链接</th>
        <th>位置</th>
        <th>创建时间</th>
        <th>管理操作</th>
    </tr>
    </thead>
    <foreach name='result' item='v'>
        <tr>
            <td>{$v.sort}</td>
            <td>{$v.id}</td>
            <td>
                <a href="http://{$v['url']}" target="_blank">
                    <img src="__UPLOADS__/thumb_{$v['images']}" width="100" height="100" alt="{$v['title']}" title="{$v.title}"/>
                </a>
            </td>
            <td>{$posMap[$v['position']]}</td>
            <td>{$v.created_date}</td>
            <td>
                <a href="{:U(GROUP_NAME . '/Advertise/editAdvertise',array('id'=>$v['id']))}">编辑</a>
                <a href="{:U(GROUP_NAME . '/Advertise/delAdvertise',array('id'=>$v['id']))}">删除</a>
            </td>
        </tr>
    </foreach>
</table>
<div class="inline pull-right page">{$show}</div>

<script language="Javascript">
    $(function () {
        $('#addnew').click(function(){
            window.location.href="{:U(GROUP_NAME . '/Advertise/addAdvertise')}";
        });
    });
</script>

